<template>
	<!--
    	作者：fuyuan
    	时间：2019-07-18
    	描述：用户
    -->
	<div class="Announcements">
		<div class="location">
			<div class="location-text fl">
				<img class="location-img fl" src="../../images/auditTopic/auditTopic.png" />
				<p class="fr">话题审核列表</p>
			</div>
			<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
		</div>
		<div class="search-box">
			<input name="search" class="search" id="searchUserVal" type="text" placeholder="请输入标题或者发布人" autocomplete="off" v-model="search"/>
			<select name="unaudit" class="search" placeholder="审核状态" v-model="unaudit">
				<option value="">全部</option>
				<option value="true">未审核</option>
				<option value="false">已审核</option>
			</select>
			<input class="btn" @click="getData" type="button" value="搜索" />
		</div>
		<div class="PressRelease-list">
			<table>
				<thead>
					<tr>
						<th class="width50">序号</th>
						<th class="width400">标题</th>
						<th>发布人</th>
						<th>发布时间</th>
						<th>审核状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr v-if="total==0">
						<td colspan="6">暂无数据！</td>
					</tr>
					<tr v-for="(article,index) in articleList">
						<td>{{index+1}}</td>
						<td :title="article.title" @click="topicDetail(article.id)"><span class="show-oneline-table">{{article.title}}</span></td>
						<td>{{article.publisher}}</td>
						<td>{{formatData(article.createAt, "yyyy-MM-dd")}}</td>
						<td>
              <template v-if="article.auditStatus == 0">
                未审核
              </template>
              <template v-else>
                已审核
              </template>
            </td>
						<td>
							<input type="button" value="审核" class="delete write"  v-if="article.auditStatus == 0" @click="audit(article)"/>
							<input type="button" value="审核详情" class="delete write" @click="auditDetail(article)"  v-else/>
						</td>
					</tr>

				</tbody>
			</table>
			<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
			<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
		</div>
		<!-- 审核-模态框-->
		<div v-if="auditModelShow" class="tenant-model">
			<div class="tenant-model-content">
				<header class="tenant-model-header">
					<h3>话题审核</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body audit">
					<div>
						<span>话题审核：</span>
						<label><input  type="radio" value="1" name="auditStatus" v-model="article.auditStatus"/>审核通过</label>
						<label><input  type="radio" value="2" name="auditStatus" v-model="article.auditStatus"/>审核不通过</label>
					</div>
					<div>
						<span>审核意见：</span>
						<textarea placeholder="100字以内" name="auditMsg" v-model="article.auditMsg"></textarea>
					</div>
					<div class="audit-btn">
						<button class="audit-sure" @click="auditTopic">确定</button>
						<button @click="closeModel" >取消</button>
					</div>
				</div>
			</div>
		</div>
		<!-- 审核详情-模态框-->
		<div v-if="auditDetailModelShow" class="tenant-model">
			<div class="tenant-model-content">
				<header class="tenant-model-header">
					<h3>审核详情</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body audit">
					<div>
						<span><i></i>话题审核：</span>
						<label v-if="article.auditStatus == 0">未审核</label>
            <label v-if="article.auditStatus == 1">审核通过</label>
            <label v-if="article.auditStatus == 2">审核不通过</label>
					</div>
					<div>
						<span><i></i>审核意见：</span>
						<div class="suggest">{{article.auditMsg}}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script src="./auditTopic.js"></script>

<style scoped>
	@import "auditTopic.css";
</style>
